<!-- 弹窗 -->
<template>
	<view class="my-dlg" v-if="dlgShow">
		<!-- 遮罩层 -->
		<view class="dlg-mask">
			<!-- 弹窗本体 -->
			<view class="dlg-body">
				<!-- 标题区域 -->
				<view class="dlg-header">
					<!-- 标题 -->
					<view class="dlg-title">{{title}}</view>
					<!-- 关闭图标 - 右上角的叉 -->
					<text class="iconfont icon-close" @click="hide"></text>
				</view>
				<!-- 弹窗内容区域 -->
				<view class="dlg-content">
					<slot>
						<text>你好，我是内容字符串，随便写点什么</text>
					</slot>
				</view>
				<!-- 按钮区域 -->
				<view class="dlg-footer">
					<slot name="footer">
						<view>
							<view class="dlg-footer-btn" @click="hide">关闭</view>
							<view class="dlg-footer-btn" @click="$emit('submit');">确定</view>
						</view>
					</slot>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	// import commonMixins from "@/mixins/commonMixins";
	export default {
		// mixins: [commonMixins],
		components: {},
		props: {
			title: {
				type: String,
				default: "提示",
			},
		},
		data() {
			return {
				dlgShow: false, // 弹窗显隐
			}
		},
		onLoad(e) {},
		onShow() {},
		methods: {
			show() {
				this.dlgShow = true;
			},
			hide() {
				this.dlgShow = false;
			}
		},
	}
</script>
<style lang="scss" scoped>
	// 引入sass样式变量(本来想全局引入，但是不成功，以后有空再解决)
	@import '@/static/scss/variables.scss';
</style>
<style lang="scss">
</style>